<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class UserBuy extends Model
{
    protected $table = 'user_buy';
    protected $guarded = [];

    public static function checkBuy($type, $item_id, $user_id)
    {
        return self::query()->where('item_type', $type)
            ->where('item_id', $item_id)
            ->where('user_id', $user_id)
            ->first();
    }
}
